package com.zr.domain.sp;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
@ServletComponentScan(basePackages = {"com.zr.sp.servlet", "com.zr.sp.filter"})
public class SpringBootDemoApplication {

    public static void main(String[] args) {
        //1.获取ioc容器
        ConfigurableApplicationContext run = SpringApplication.run(SpringBootDemoApplication.class, args);
        //2.查看容器中各种组件
        for (String beanDefinitionName : run.getBeanDefinitionNames()) {
            System.out.println(beanDefinitionName);
        }
//        System.out.println("----------------------");
//        Teacher teacher = (Teacher) run.getBean("teacher");
//        System.out.println(teacher.toString());
    }

}
